package com.sangfor.ssl;

import com.sangfor.ssl.IConstants;
import java.util.ArrayList;
import java.util.List;

/* loaded from: classes2.dex */
public class StatusChangeManager {
    private static final StatusChangeManager INSTANCE = new StatusChangeManager();
    private List<OnStatusChangedListener> statusChangedListenerList = new ArrayList();

    private StatusChangeManager() {
    }

    public static StatusChangeManager getInstance() {
        return INSTANCE;
    }

    public void addStatusChangedListener(OnStatusChangedListener onStatusChangedListener) {
        synchronized (this.statusChangedListenerList) {
            if (!this.statusChangedListenerList.contains(onStatusChangedListener)) {
                this.statusChangedListenerList.add(onStatusChangedListener);
            }
        }
    }

    public void removeStatusChangedListener(OnStatusChangedListener onStatusChangedListener) {
        synchronized (this.statusChangedListenerList) {
            if (this.statusChangedListenerList.contains(onStatusChangedListener)) {
                this.statusChangedListenerList.remove(onStatusChangedListener);
            }
        }
    }

    public void clearStatusChangedListener() {
        synchronized (this.statusChangedListenerList) {
            this.statusChangedListenerList.clear();
        }
    }

    public void notifyStatusListener(IConstants.VPNStatus vPNStatus, StatusChangedReason statusChangedReason) {
        synchronized (this.statusChangedListenerList) {
            for (OnStatusChangedListener onStatusChangedListener : this.statusChangedListenerList) {
                onStatusChangedListener.onStatusCallback(vPNStatus, statusChangedReason);
            }
        }
    }
}
